{extend name="../../../base/view/common/base" /}
{block name="style"}
<style>
    .layui-form-item .layui-form-label {
        width: 120px;
    }
    .layui-form-item .layui-input-block {
        margin-left: 140px;
    }
</style>
{/block}
{block name="body"}
<div class="layui-form p-page">
    <h3 class="pb-3">编辑联系电话</h3>
    <form class="layui-form" lay-filter="editPhoneForm">
        <input type="hidden" name="id" value="{$phone.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">电话号码</label>
            <div class="layui-input-block">
                <input type="text" name="phone" value="{$phone.phone}" required lay-verify="required|phone_format" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话描述</label>
            <div class="layui-input-block">
                <textarea name="description" class="layui-textarea" placeholder="请输入描述信息">{$phone.description}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="submitBtn">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script>
const moduleInit = ['form'];
function gouguInit() {
    layui.form.on('submit(submitBtn)', function(data){
        layui.tool.post('/lawcase/api/court/updatePhone', data.field, function(res){
            if(res.code === 0) {
                parent.layer.closeAll();
                parent.layui.table.reload('courtPhoneTable');
            }
        });
        return false;
    });
}
</script>
{/block}